(define (flatten slist)
    (cond
        ((null? slist) `())
        ((list? (car slist)) 
            (append
                (flatten (car slist))
                (flatten (cdr slist))
            )
        )
        (else
            (append
                (list (car slist))
                (flatten (cdr slist))
            )
        )    
    )
)

(display
    (flatten `(a b c))
)

(display
    (flatten `((a) () (b ()) () (c)))
)

(display
    (flatten `((a b) c (((d)) e)))
)

(display
    (flatten `(a b (() (c))))
)
